Skip to content

Create allDevicesWithRoundedDisplayCorners and hasRoundedDisplayCorners variables. - #166

Closed
Zandor300 wants to merge 5 commits into
devicekit:masterfrom
Zandor300:master
Closed

Create allDevicesWithRoundedDisplayCorners and hasRoundedDisplayCorners variables.#166
Zandor300 wants to merge 5 commits into
devicekit:masterfrom
Zandor300:master

Conversation

@Zandor300

@Zandor300 Zandor300 commented Mar 4, 2019

Copy link
Copy Markdown
Member

Create allDevicesWithRoundedDisplayCorners and hasRoundedDisplayCorners variables like suggested in #159. Doesn't however implement the breaking changes that were also suggested there so the issue shouldn't be closed.

Would like to also implement a variable for getting the actual corner radius of the display but according to this StackOverflow answer, it isn't as simple as just setting layer.cornerRadius: https://apple.stackexchange.com/a/336499/277581

(Additional commits are because I screwed up syncing my fork's master with upstream)

@Zandor300

Copy link
Copy Markdown
Member Author

@dennisweissmann sorry for yet another mail notification 😜

@devicekit-danger-bot

devicekit-danger-bot commented Mar 4, 2019

Copy link
Copy Markdown
4 Warnings
⚠️ Plist changed, don’t forget to localize your plist values
⚠️ Source/Device.generated.swift#L290 - Function body should span 40 lines or less excluding comments and whitespace: currently spans 63 lines
⚠️ Source/Device.generated.swift#L607 - TODOs should be resolved (Longterm we need a better solu…).
⚠️ Source/Device.generated.swift#L1119 - Prefer empty collection over optional collection.

SwiftLint found issues

Warnings

File Line Reason
Device.generated.swift 1119 Prefer empty collection over optional collection.
Device.generated.swift 607 TODOs should be resolved (Longterm we need a better solu...).
Device.generated.swift 290 Function body should span 40 lines or less excluding comments and whitespace: currently spans 63 lines

Generated by 🚫 Danger

@Zandor300

Copy link
Copy Markdown
Member Author

@dennisweissmann Also, I suggest creating a 2.0 branch to start working on that to solve some of the issues that have breaking changes? If you're going to do that, I would suggest waiting on releasing my previous changes to save it for 2.0.

@dennisweissmann

Copy link
Copy Markdown
Collaborator

Alright, I wanted to release an 2.0 with (at least) Swift 5.0, since that’s around the corner it makes sense to me.

This repo uses master as the dev branch, so I would be fine with committing whatever you want to master. If there is something we should backport to an 1.X version we could cherrypick. WDYT?

@Zandor300

Copy link
Copy Markdown
Member Author

In that case, I'm fine with merging this pull request if you are.

Do you want me to already make some changes for 2.0, like fixing issues like #149 and #130 if I have some spare time this week?
I think its better to create a 2.0 branch for those changes but then have this pull request still be for a 1.x release.

Zandor300 added a commit to Zandor300/DeviceKit that referenced this pull request Mar 18, 2019
@Zandor300 Zandor300 closed this Mar 18, 2019
denisenepraunig pushed a commit that referenced this pull request Apr 10, 2019
* Add boolean and array functions to check if the device has a sensor housing.

* Move variables together.

* Rename allDevicesWithASensorHousing to allDevicesWithSensorHousing.

* Create allDevicesWithRoundedDisplayCorners and hasRoundedDisplayCorners variables.

* Create branch for 2.0 changes.

* Rename iPhone Xs to XS and Xr to XR (fixes #149)

* Fixed generation of allDevicesWithSensorHousing and hasSensorHousing through the gyb file.

* Check if device is current.

* Fixed formatting.

* Check for current device in isZoomed.

* Add documentation to the isCurrent variable.

* Add static current variable and make the initialiser private.

* Revert commit used to create the patch branch in my fork.

* Fixed readme so that it also contains the rename of XS and XR.

* Check for isCurrent on the isPhone and isPad variables when DeviceKit hasn't been updated for a new device yet. (Fixes #165)

* Change device description to use small caps on iPhone XS (Max) and iPhone XR.

* Changed all if !isCurrent statements to guards.

* Remove .instance and the initialiser and completely move over to .current.

* Fixed names of iPad 3, 4, 5 and 6.

* Fix #166 not being added through the gyb file.

* Fix documentation inside code to use Device.current instead of the constructor.

* Fixed readme to use Device.current instead of the constructor.

* Add new iPad Air (3th generation) and iPad Mini (5th generation).

* Revert Zandor300@3eec7cd

* Update to Swift 5.

* Update tests for breaking changes.

* Fix merge.

* Fixed code alignment.

* Fixed trailing whitespace violations.

* Disable the function_body_length rule on mapToDevice(String).

Since this function is generated with a switch for all devices, this needs to be this long.

* Use Xcode 10.2 to build and test the project.

This is required because Swift 5 isn't supported in Xcode 10.1.

* Set .swift-version to 5.0

* Fixed description tests.

* Add iPad (6th gen), iPad Air (3rd gen) and iPad Mini (5th gen) to the description test.

* Fixed one test that still used Device().

* Created new test to prevent #165 from happening again.

* Disable the function_body_length swiftlint rule on the testDescription().

* Added a bunch of tech specs and image links where missing.

* Fixed spacing and another couple urls.

* Add Swift 5 information to the readme.

* Add a default case to the switch to cover future additions to WKInterfaceDeviceBatteryState. (Thanks robbiet480)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants